package com.bang.study.day07;

import com.bang.study.day08.RBTree;

/**
 * @Auther: Bang
 * @Date: 2019/9/19 0019 11:43
 * @Description:
 */
public class RBTreeMap<K extends Comparable<K>, V> implements Map<K, V> {


    private RBTree<K, V> rbTree;

    public RBTreeMap() {
        this.rbTree = new RBTree<>();
    }

    @Override
    public void add(K key, V value) {
        rbTree.add(key, value);
    }

    @Override
    public boolean contains(K key) {
        return rbTree.contains(key);
    }

    @Override
    public V get(K key) {
        return rbTree.get(key);
    }

    @Override
    public void set(K key, V newValue) {
        rbTree.set(key, newValue);
    }

    @Override
    public V remove(K key) {
        return null;
    }

    @Override
    public int getSize() {
        return rbTree.getSize();
    }

    @Override
    public boolean isEmpty() {
        return rbTree.isEmpty();
    }
}
